package com.ruoyi.system.controller;


import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.dto.CategoryListTreeDTO;
import com.ruoyi.system.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 品类Controller
 *
 * @author Administrator
 */
@RestController
@RequestMapping("/category")
@RequiredArgsConstructor
public class CategoryController {


    private final CategoryService categoryService;

    /**
     * 获取品类三级列表
     *
     * @return 品类三级列表
     */
    @GetMapping
    public R<List<CategoryListTreeDTO>> listTree() {
        return R.ok(categoryService.listTree());
    }

}
